<?php
namespace frontend\controllers;

use Yii;
use yii\web\Controller;
use common\models\YmhSeo;
use common\models\Product;

class ProductController extends Controller {

    public function actionProduct() {
        $request = Yii::$app->request;
        $id = $request->get('id');
        $seo=YmhSeo::findOne(3);
        $view = Yii::$app->view;
        $view->params['layout_data']['menu'] = 'product';
        $view->params['layout_data']['seo'] = $seo;
        $pro_list = Product::getProCat();
        $view->params['layout_data']['pro_list'] = $pro_list;
        return $this->render("product",['pro_list'=>$pro_list,'id'=>$id]);
    } 
    
    
    public function actionMProduct(){
        $this->layout = 'main_local';
        $request = Yii::$app->request;
        $id = $request->get('id');
        $seo=YmhSeo::findOne(3);
        $view = Yii::$app->view;
        $view->params['layout_data']['menu'] = 'product';
        $view->params['layout_data']['seo'] = $seo;
        $pro_list = Product::getProCat();
        $view->params['layout_data']['pro_list'] = $pro_list;
        return $this->render("m-product",['pro_list'=>$pro_list,'id'=>$id]);
    }

}

?>